package com.ruoyi.business.service.impl;

import com.ruoyi.business.domain.TSmjGoodList;
import com.ruoyi.business.mapper.TSmjGoodListMapper;
import com.ruoyi.business.service.ITSmjGoodListService;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 售卖机物品信息Service业务层处理
 * 
 * @author admin
 * @date 2024-10-24
 */
@Service
public class TSmjGoodListServiceImpl implements ITSmjGoodListService
{
    @Autowired
    private TSmjGoodListMapper tSmjGoodListMapper;

    /**
     * 查询售卖机物品信息
     * 
     * @param id 售卖机物品信息ID
     * @return 售卖机物品信息
     */
    @Override
    public TSmjGoodList selectTSmjGoodListById(Long id)
    {
        return tSmjGoodListMapper.selectTSmjGoodListById(id);
    }

    /**
     * 查询售卖机物品信息列表
     * 
     * @param tSmjGoodList 售卖机物品信息
     * @return 售卖机物品信息
     */
    @Override
    @DataScope(userAlias = "t")
    public List<TSmjGoodList> selectTSmjGoodListList(TSmjGoodList tSmjGoodList)
    {
        return tSmjGoodListMapper.selectTSmjGoodListList(tSmjGoodList);
    }

    @Override
    public List<TSmjGoodList> selectTSmjGoodListListByNoAuth(TSmjGoodList tSmjGoodList) {
        return tSmjGoodListMapper.selectTSmjGoodListListByNoAuth(tSmjGoodList);
    }

    /**
     * 新增售卖机物品信息
     * 
     * @param tSmjGoodList 售卖机物品信息
     * @return 结果
     */
    @Override
    public int insertTSmjGoodList(TSmjGoodList tSmjGoodList)
    {
        tSmjGoodList.setCreateTime(DateUtils.getNowDate());
        return tSmjGoodListMapper.insertTSmjGoodList(tSmjGoodList);
    }

    /**
     * 修改售卖机物品信息
     * 
     * @param tSmjGoodList 售卖机物品信息
     * @return 结果
     */
    @Override
    public int updateTSmjGoodList(TSmjGoodList tSmjGoodList)
    {
        tSmjGoodList.setUpdateTime(DateUtils.getNowDate());
        return tSmjGoodListMapper.updateTSmjGoodList(tSmjGoodList);
    }

    /**
     * 删除售卖机物品信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTSmjGoodListByIds(String ids)
    {
        return tSmjGoodListMapper.deleteTSmjGoodListByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除售卖机物品信息信息
     * 
     * @param id 售卖机物品信息ID
     * @return 结果
     */
    @Override
    public int deleteTSmjGoodListById(Long id)
    {
        return tSmjGoodListMapper.deleteTSmjGoodListById(id);
    }

    @Override
    public int deleteTSmjGoodListByMachineIds(String ids) {
        return tSmjGoodListMapper.deleteTSmjGoodListByMachineIds(Convert.toStrArray(ids));
    }

    @Override
    public int deleteTSmjGoodListByMachineId(long id) {
        return tSmjGoodListMapper.deleteTSmjGoodListByMachineId(id);
    }

    @Override
    public TSmjGoodList selectTSmjGoodListListByLimit(TSmjGoodList tSmjGoodList) {

        return tSmjGoodListMapper.selectTSmjGoodListListByLimit(tSmjGoodList);
    }

    @Override
    public int updateTSmjGoodNum(TSmjGoodList tSmjGoodList) {
        return tSmjGoodListMapper.updateTSmjGoodNum(tSmjGoodList);
    }
}
